﻿Imports TMySQL
Public Class frmEvent
    Implements ITabForm
    Private _Event As TMyEvent
    Public Sub New(ByVal AEvent As TMyEvent)
        Me.New()
        _Event = AEvent
        InitFrm()
    End Sub
    Private Sub New()
        ' この呼び出しは、Windows フォーム デザイナで必要です。
        InitializeComponent()
        ' InitializeComponent() 呼び出しの後で初期化を追加します。
    End Sub

    Private Sub InitFrm()
        txtEventSchema.Text = _Event.EventSchema
        txtEventName.Text = _Event.EventName
        txtStatus.Text = _Event.Status
        txtOnCompletion.Text = _Event.OnCompletion
        txtStarts.Text = Common.DateTimeToString(_Event.Starts)
        txtEnds.Text = Common.DateTimeToString(_Event.Ends)
        If _Event.EventType = "ONE TIME" Then
            txtSpan.Text = Common.DateTimeToString(_Event.ExecuteAt)
        Else
            txtSpan.Text = _Event.IntervalValue.ToString & " " & _Event.IntervalField
        End If
        txtCreated.Text = Common.DateTimeToString(_Event.Created)
        txtLastAltered.Text = Common.DateTimeToString(_Event.LastAltered)
        txtLastExecuted.Text = Common.DateTimeToString(_Event.LastExecuted)
        txtComment.Text = _Event.EventComment
        txtSource.Text = _Event.Source
        frmMain.GeneralSettings.ApplyAll(Me)
        frmMain.EditorSettings.ApplyAll(Me)
        frmMain.GridSettings.ApplyAll(Me)
    End Sub
End Class